package teacher.action.student;

import com.opensymphony.xwork2.ActionSupport;
import teacher.bean.Students;
import teacher.service.student;
import tools.StringDate;

public class modifyStu extends ActionSupport{

	private static final long serialVersionUID = 1L;
	private Students st;
	private String dates;
	private int sid;
	String suc;

	public int getSid() {
		return sid;
	}

	public void setSid(int sid) {
		this.sid = sid;
	}

	public String getSuc() {
		return suc;
	}

	public void setSuc(String suc) {
		this.suc = suc;
	}

	public String getDates() {
		return dates;
	}

	public void setDates(String dates) {
		this.dates = dates;
	}

	public Students getSt() {
		return st;
	}

	public void setSt(Students st) {
		this.st = st;
	}

	public String execute() throws Exception{
		st.setLeaveDate(new StringDate().StringToDate(dates));
		Students stuold=new Students();
		stuold=new student().selectStudentByStu(st);
	   this.setSid(stuold.getStuId());
		st.setTeaId(stuold.getTeaId());
		if(new student().updateStudent(st, stuold))
		{
			this.setSuc("success");
		    return SUCCESS;
		}else{
			return ERROR;
		}
		
	}

}
